package com.example.mosbytest.api;


import com.example.mosbytest.ui.view.LoginView;

/**
 * @author lizhangqu
 * @since 2016-02-21 10:41
 */
public class LoginApi {
    public static void login(String username, String password, Listener<String> listener) {
        if (username.equals("admin") && password.equals("admin")) {
            listener.onSuccess(null);
        } else if (username.equals("server") && password.equals("server")) {
            listener.onFailure(LoginView.SERVER_ERROR);
        } else {
            listener.onFailure(LoginView.USERNAME_OR_PASSWORD_ERROR);
        }
    }
}
